package org.example.message.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.message.model.MessageInfo;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-07-13
 * Time: 9:47
 */
@Mapper
public interface MessageMapper {

    @Insert("insert into message_info(`from`,`to`,`message`) " +
            "values(#{from},#{to},#{message})")
    void insertMessage(MessageInfo messageInfo);


    @Select("select * from message_info where delete_flag=0")
    List<MessageInfo> selectAllMessage();
}
